*** Generates data summary descriptive statistics
clear
set more off
pause on

cd ""
use base_FE_para_all



global dems "sex age17 age18 age19plus english kidbornc wsiblings   ageparent p_native pnbchild p_uni_imp p_uni p_drop Q9_income_20_40 Q9_income_40_60 Q9_income_60_80 Q9_income_80_100 Q9_income_100plus    "

foreach var in obs av med mobs fobs {
	capture drop r_`var'
	capture gen r_`var'=.
	}
	
gen r_name=""
	
local i=1	
foreach var of varlist $dems {
	replace r_name="`var'" in `i'
	sum `var',d
	replace r_obs=`r(N)' in `i'
	replace r_av=`r(mean)' in `i'
	replace r_med=`r(p50)' in `i'

	* male #
	sum `var' if sex==0,d
	replace r_mobs=`r(mean)' in `i'
	
	* female number
	sum `var' if sex==1,d
	replace r_fobs=`r(mean)' in `i'	
	
	local ++i
	}
